﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>在新窗口中输出数据</title>
    <script>
        function createDoc() {
            let w = window.open();
            w.document.open();
            w.document.write("<h1>hello js</h1>");
            w.document.close();
        }
    </script>
</head>
<body>
    <input type="button" value="新窗口的新文档" onclick="createDoc()" />
</body>
</html>